﻿using Zo.Tasks;

namespace Zo.Logging
{
    public class TxtLogger : LoggerBase
    {
        private readonly IMonoConcurrentTask _monoConcurrentTask;

        public TxtLogger()
        {
            _monoConcurrentTask = new TxtLogMonoConcurrentTask();
        }

        protected override void WriteLog(string message, string functionType, string logType)
        {
            _monoConcurrentTask.Handler(new TxtLogDTO
            {
                Message = message,
                FunctionType = functionType ?? string.Empty,
                LogType = logType ?? string.Empty
            });
        }
    }

    internal class TxtLogDTO
    {
        public string Message { get; set; }

        public string LogType { get; set; }

        public string FunctionType { get; set; }
    }
}